// 封装所有关于组织结构的接口
import instance from '@/utils/request'

//
// 封装登录接口并暴露出去
export function getDepartment () {
  return instance({
    url: '/api/company/department',
    method: 'get'
  })
}

// 封装删除组织架构接口
export function deleteDepartment(id){
  return instance({
    url: `/api/company/department/${id}`,
    method: 'delete'
  })
}

// 新增组织架构部门的接口
export function addDepartment(data){
  return instance({
    url: '/api/company/department',
    method: 'post',
    data
  })
}

// 封装修改部门接口
export function updateDepartment(data){
  return instance({
    url: `/api/company/department/${data.id}`,
    method: 'put',
    data
  })
}